package com.fs.server.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class AuthRunner implements ApplicationRunner {
	
	private static final Logger logger = LoggerFactory.getLogger(AuthRunner.class);
	@Autowired
	private PasswordEncoder passwordEncoder;
	@Override
	public void run(ApplicationArguments arg0) throws Exception {
		BCryptPasswordEncoder encoder =new BCryptPasswordEncoder();
		String pwd = encoder.encode("sa");
		System.out.println(pwd);
		logger.info("fs-auth-service start successfully!");
		 
	}

}
